/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package statisticaldata;

/**
 *
 * @author chris
 */
public class StatisticalData {

    private double price;

    public StatisticalData(double price) {
        setPrice(price);
    }

    public StatisticalData() {
        this(0.0);
    }

    public StatisticalData(StatisticalData other) {
        this(other.getPrice());
    }
    
    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        if (price > 0.0) {
            this.price = price;
        } else {
            price = 0.0;
        }
    }

    @Override
    public String toString() {
        return String.format("Price: %.2f", getPrice());
    }
    
    boolean larger(StatisticalData data) {
        if (this.price > data.price) {
            return true;
        }
        return false;
    }

}
